package com.kotasoft.iip.validation;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;

import com.kotasoft.iip.model.insurance.Order;
import com.kotasoft.iip.model.interfaces.HasOrder;

public class PaymentValidator implements Processor {

	public void process(Exchange exchange) throws Exception {
		Order order = exchange.getIn().getBody(HasOrder.class).getOrder();
		if (order.getAmount() == null) {
			throw new RuntimeException("Missing amount");
		}
	}
}
